home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / C and C++ / Utilities / indent-1.8 / indent.1 < prev    next >
Text File  |  1993-12-16  |  29KB  |  1,000 lines

  1.  
  2. .\" $Id$
  3. .\"
  4. .TH INDENT 1L 
  5. .\" NAME should be all caps, SECTION should be 1-8, maybe w/ subsection
  6. .\" other parms are allowed: see man(7), man(1)
  7. .SH NAME
  8. indent \- changes the appearance of a C program by inserting or deleting
  9. whitespace.
  10. .SH SYNOPSIS
  11. .nf
  12. .na
  13. indent [-bad] [-bap] [-bbb] [-bc] [-bl] [-bliN] [-br] [-cN] [-cdN] [-cdb]
  14.     [-ce] [-ciN] [-cliN] [-cpN] [-cs] [-bs] [-dN] [-diN] [-fc1] [-fca]
  15.     [-gnu] [-iN] [-ipN] [-kr] [-lN] [-lp] [-nbad] [-nbap] [-nbbb]
  16.     [-nbc] [-ncdb] [-nce] [-ncs] [-nfc1] [-nfca] [-nip] [-nlp] [-npcs]
  17.     [-npsl] [-nsc] [-nsob] [-nss] [-nv] [-orig] [-npro] [-pcs] [-psl]
  18.     [-sc] [-sob] [-ss] [-st] [-T] [-tsN] [-v] [-version] [file]
  19. .ad
  20. .fi
  21. .SH "DESCRIPTION"
  22. This man page is based on the Info file indent.info, produced by Makeinfo-1.47
  23. from the input file indent.texinfo.  This is Edition 0.02, 5 May 1992, of
  24. The `indent' Manual, for Indent Version 1.3.
  25.  
  26. Copyright (C) 1989, 1992 Free Software Foundation, Inc.
  27. .SH "COPYING"
  28. Permission is granted to make and distribute verbatim copies of this
  29. manual provided the copyright notice and this permission notice are
  30. preserved on all copies.
  31. .SH "INTRODUCTION"
  32. The `indent' program can be used to make code easier to read.  It
  33. can also convert from one style of writing C to another.
  34.  
  35. `indent' understands a substantial amount about the syntax of C, but
  36. it also attempts to cope with incomplete and misformed syntax.
  37.  
  38. In version 1.2 and more recent versions, the GNU style of indenting
  39. is the default.
  40. .SH "INVOKING INDENT"
  41.  
  42. As of version 1.3, the format of the `indent' command is:
  43.  
  44. .in +5
  45. indent [OPTIONS] [INPUT-FILES]
  46.  
  47. indent [OPTIONS] [SINGLE-INPUT-FILE] [-o OUTPUT-FILE]
  48.  
  49. .in -5
  50. This format is different from earlier versions and other versions of
  51. `indent'.
  52.  
  53. In the first form, one or more input files are specified.  `indent'
  54. makes a backup copy of each file, and the original file is replaced with
  55. its indented version.  *Note Backup files::, for an explanation of how
  56. backups are made.
  57.  
  58. In the second form, only one input file is specified.  In this case,
  59. or when the standard input is used, you may specify an output file after
  60. the `-o' option.
  61.  
  62. To cause `indent' to write to standard output, use the `-st' option.
  63. This is only allowed when there is only one input file, or when the
  64. standard input is used.
  65.  
  66. If no input files are named, the standard input is read for input.
  67. Also, if a filename named `-' is specified, then the standard input is
  68. read.
  69.  
  70. As an example, each of the following commands will input the program
  71. `slithy_toves.c' and write its indented text to `slithy_toves.out':
  72.  
  73. .in +5
  74. indent slithy_toves.c -o slithy_toves.out
  75.  
  76. indent -st slithy_toves.c > slithy_toves.out
  77.  
  78. cat slithy_toves.c | indent -o slithy_toves.out
  79.  
  80. .in -5
  81. Most other options to `indent' control how programs are formatted.
  82. As of version 1.2, `indent' also recognizes a long name for each option
  83. name.  Long options are prefixed by either `--' or `+'.  `+' is being
  84. superseded by `--' to maintain consistency with the POSIX standard.
  85. In most of this document, the traditional, short names are used for the
  86. sake of brevity.
  87.  
  88. Here is another example:
  89.  
  90. .in +5
  91. indent -br test/metabolism.c -l85
  92.  
  93. .in -5
  94. This will indent the program `test/metabolism.c' using the `-br' and
  95. `-l85' options, write the output back to `test/metabolism.c', and write
  96. the original contents of `test/metabolism.c' to a backup file in the
  97. directory `test'.
  98.  
  99. Equivalent invocations using long option names for this example would
  100. be:
  101.  
  102. .in +5
  103. indent --braces-on-if-line --line-length185 test/metabolism.c
  104.  
  105. indent +braces-on-if-line +line-length185 test/metabolism.c
  106.  
  107. .in -5
  108. If you find that you often use `indent' with the same options, you
  109. may put those options into a file called `.indent.pro'. `indent' will
  110. first look for `.indent.pro' in the current directory and use that if
  111. found.  Otherwise, `indent' will search your home directory for
  112. `.indent.pro' and use that file if it is found.  This behaviour is
  113. different from that of other versions of `indent', which load both
  114. files if they both exist.
  115.  
  116. Command line switches are handled *after* processing `.indent.pro'. 
  117. Options specified later override arguments specified earlier, with one
  118. exception: Explicitly specified options always override background
  119. options (*note Common styles::.).  You can prevent `indent' from
  120. reading an `.indent.pro' file by specifying the `-npro' option.
  121. .SH "BACKUP FILES"
  122. As of version 1.3, GNU `indent' makes GNU--style backup files, the
  123. same way GNU Emacs does.  This means that either "simple" or "numbered"
  124. backup filenames may be made.
  125.  
  126. Simple backup file names are generated by appending a suffix to the
  127. original file name.  The default for the this suffix is the
  128. one-character string `~' (tilde).  Thus, the backup file for `python.c'
  129. would be `python.c~'.
  130.  
  131. Instead of the default, you may specify any string as a suffix by
  132. setting the environment variable `SIMPLE_BACKUP_SUFFIX' to your
  133. preferred suffix.
  134.  
  135. Numbered backup versions of a file `momewraths' look like
  136. `momewraths.c.~23~', where 23 is the version of this particular backup.
  137. When making a numbered backup of the file `src/momewrath.c', the
  138. backup file will be named `src/momewrath.c.~V~', where V is one greater
  139. than the highest version currently existing in the directory `src'.
  140.  
  141. The type of backup file made is controlled by the value of the
  142. environment variable `VERSION_CONTROL'.  If it is the string `simple',
  143. then only simple backups will be made.  If its value is the string
  144. `numbered', then numbered backups will be made.  If its value is
  145. `numbered-existing', then numbered backups will be made if there
  146. *already exist* numbered backups for the file being indented;
  147. otherwise, a simple backup is made.  If `VERSION_CONTROL' is not set,
  148. then `indent' assumes the behaviour of `numbered-existing'.
  149.  
  150. Other versions of `indent' use the suffix `.BAK' in naming backup
  151. files.  This behaviour can be emulated by setting
  152. `SIMPLE_BACKUP_SUFFIX' to `.BAK'.
  153.  
  154. Note also that other versions of `indent' make backups in the
  155. current directory, rather than in the directory of the source file as
  156. GNU `indent' now does.
  157. .SH "COMMON STYLES"
  158. There are several common styles of C code, including the GNU style,
  159. the Kernighan & Ritchie style, and the original Berkeley style.  A
  160. style may be selected with a single "background" option, which
  161. specifies a set of values for all other options.  However, explicitly
  162. specified options always override options implied by a background
  163. option.
  164.  
  165. As of version 1.2, the default style of GNU `indent' is the GNU
  166. style.  Thus, it is no longer neccessary to specify the option `-gnu'
  167. to obtain this format, although doing so will not cause an error. 
  168. Option settings which correspond to the GNU style are:
  169.  
  170. .in +5
  171. -nbad -bap -nbbb -nbc -bl -bli2 -c33 -cd33 -ncdb -nce
  172. -cli0 -cp1 -di0 -nfc1 -nfca -i2 -ip5 -lp -pcs -psl
  173. -nsc -nsob -nss -ts8
  174.  
  175. .in -5
  176. The GNU coding style is that preferred by the GNU project.  It is the
  177. style that the GNU Emacs C mode encourages and which is used in the C
  178. portions of GNU Emacs.  (People interested in writing programs for
  179. Project GNU should get a copy of `The GNU Coding Standards', which also
  180. covers semantic and portability issues such as memory usage, the size
  181. of integers, etc.)
  182.  
  183. The Kernighan & Ritchie style is used throughout their well-known
  184. book `The C Programming Language'.  It is enabled with the `-kr'
  185. option.  The Kernighan & Ritchie style corresponds to the following set
  186. of options:
  187.  
  188. .in +5
  189. -nbad -bap -nbbb -nbc -br -c33 -cd33 -ncdb -ce -ci4
  190. -cli0 -cp33 -d0 -di1 -nfc1 -nfca -i4 -ip0 -l75 -lp
  191. -npcs -npsl -nsc -nsob -nss -ts8
  192.  
  193. .in -5
  194. Kernighan & Ritchie style does not put comments to the right of code in
  195. the same column at all times (nor does it use only one space to the
  196. right of the code), so for this style `indent' has arbitrarily chosen
  197. column 33.
  198.  
  199. The style of the original Berkeley `indent' may be obtained by
  200. specifying `-orig' (or by specifyfying `--original', using the long
  201. option name).  This style is equivalent to the following settings:
  202.  
  203. .in +5
  204. -nbap -nbad -nbbb -bc -br -c33 -cd33 -cdb -ce -ci4
  205. -cli0 -cp33 -d4 -di16 -fc1 -fca -i4 -ip4 -l75 -lp
  206. -npcs -psl -sc -nsob -nss -ts8
  207.  
  208. .in -5
  209. .SH "BLANK LINES"
  210. Various programming styles use blank lines in different places.
  211. `indent' has a number of options to insert or delete blank lines in
  212. specific places.
  213.  
  214. The `-bad' option causes `indent' to force a blank line after every
  215. block of declarations.  The `-nbad' option causes `indent' not to force
  216. such blank lines.
  217.  
  218. The `-bap' option forces a blank line after every procedure body.
  219. The `-nbap' option forces no such blank line.
  220.  
  221. The `-bbb' option forces a blank line before every block comment. A
  222. block comment is one which starts in column one when formatting of such
  223. comments is disabled, or one with `-' or `*' immediately following the
  224. `/*'.  The `-nbbb' option does not force such blank lines.
  225.  
  226. The `-sob' option causes `indent' to swallow optional blank lines
  227. (that is, any optional blank lines present in the input will be removed
  228. from the output).  If the `-nsob' is specified, any blank lines present
  229. in the input file will be copied to the output file.
  230.  
  231. The `-bad' option forces a blank line after every block of
  232. declarations.  The `-nbad' option does not add any such blank lines.
  233.  
  234. For example, given the input
  235.  
  236. .in +5
  237. .nf
  238. .na
  239.      char *foo;
  240.      char *bar;
  241.      /* This separates blocks of declarations.  */
  242.      int baz;
  243.  
  244. .in -5
  245. .ad
  246. .fi
  247. `indent -bad' produces
  248.  
  249.  
  250. .in +5
  251. .nf
  252. .na
  253.      char *foo;
  254.      char *bar;
  255.      
  256.      /* This separates blocks of declarations.  */
  257.      int baz;
  258.  
  259. .in -5
  260. .ad
  261. .fi
  262. and `indent -nbad' produces
  263.  
  264. .in +5
  265. .nf
  266. .na
  267.      char *foo;
  268.      char *bar;
  269.      /* This separates blocks of declarations.  */
  270.      int baz;
  271.  
  272. .in -5
  273. .ad
  274. .fi
  275. The `-bap' option forces a blank line after every procedure body.
  276. For example, given the input
  277.  
  278. .in +5
  279. .nf
  280. .na
  281.      int
  282.      foo ()
  283.      {
  284.        puts("Hi");
  285.      }
  286.      /* The procedure bar is even less interesting.  */
  287.      char *
  288.      bar ()
  289.      {
  290.        puts("Hello");
  291.      }
  292.  
  293. .in -5
  294. .ad
  295. .fi
  296. `indent -bap' produces
  297.  
  298. .in +5
  299. .nf
  300. .na
  301.      int
  302.      foo ()
  303.      {
  304.        puts ("Hi");
  305.      }
  306.      
  307.      /* The procedure bar is even less interesting.  */
  308.      char *
  309.      bar ()
  310.      {
  311.        puts ("Hello");
  312.      }
  313.  
  314. .in -5
  315. .ad
  316. .fi
  317. and `indent -nbap' produces
  318.  
  319. .in +5
  320. .nf
  321. .na
  322.      int
  323.      foo ()
  324.      {
  325.        puts ("Hi");
  326.      }
  327.      /* The procedure bar is even less interesting.  */
  328.      char *
  329.      bar ()
  330.      {
  331.        puts ("Hello");
  332.      }
  333.  
  334. .in -5
  335. .ad
  336. .fi
  337. No blank line will be added after the procedure `foo'.
  338. .SH "COMMENTS"
  339. Comments are no longer formatted by default as of version 1.2.  This
  340. can be enabled with the `-fca' option.  Doing so will cause newlines in
  341. the comment text to be ignored and the line will be filled up to the
  342. length of a line (which can be modified with `-l').  When formatting is
  343. enabled, blank lines indicate paragraph breaks.
  344.  
  345. The `-fc1' option enables the formatting of comments which begin in
  346. the first column.  The `-nfc1' option disables the formatting of first
  347. column comments.  When comment formatting is disabled, overall comment
  348. indentation may still be adjusted.
  349.  
  350. The indentation of comments which do not appear to the right of code
  351. is set by the `-d' option, which specifies the number of spaces to the
  352. left of the surrounding code that the comment appears.  For example,
  353. `-d2' places comments two spaces to the left of code; `-d0' lines up
  354. comments with the code.  The `-cdb' option controls whether the `/*'
  355. and `*/' are placed on blank lines.  With `-cdb', comments look like
  356. this:
  357.  
  358. .in +5
  359. .nf
  360. .na
  361.      /*
  362.       * this is a comment
  363.       */
  364.  
  365. .in -5
  366. .ad
  367. .fi
  368. With `-ncdb', comments look like this:
  369.  
  370. .in +5
  371. .nf
  372. .na
  373.      /* this is a comment */
  374.  
  375. .in -5
  376. .ad
  377. .fi
  378. `-cdb' only affects block comments, not comments to the right of code. 
  379. The default is `-ncdb'.
  380.  
  381. Comments which appear on the same line as code are placed to the
  382. right. The column in which comments on code start is controlled by the
  383. `-c' option.  The column in which comments to the right of declarations
  384. start is controlled by the `-cd' option.  By default, they start in the
  385. same column as comments to the right of code, which is column 33.  The
  386. column number for comments to the right of `#else' and `#endif'
  387. statements is controlled by the `-cp' option.  If the code on a line
  388. extends past the comment column, the comment starts further to the
  389. right, and the right margin may be automatically extended in extreme
  390. cases.
  391.  
  392. If the `-sc' option is specified, `*' is placed at the left edge of
  393. all comments.  For example:
  394.  
  395. .in +5
  396. .nf
  397. .na
  398.      /* This is a comment which extends from one line
  399.       * onto the next line, thus causing us to consider
  400.       * how it should continue.  */
  401.  
  402. .in -5
  403. .ad
  404. .fi
  405. instead of
  406.  
  407. .in +5
  408. .nf
  409. .na
  410.      /* This is a comment which extends from one line
  411.         onto the next line, thus causing us to consider
  412.         how it should continue.  */
  413.  
  414. .in -5
  415. .ad
  416. .fi
  417. .SH "STATEMENTS"
  418. The `-br' or `-bl' option specifies how to format braces.
  419. The `-br' option formats braces like this:
  420.  
  421. .in +5
  422. .nf
  423. .na
  424.      if (x > 0) {
  425.        x--;
  426.      }
  427.  
  428. .in -5
  429. .ad
  430. .fi
  431. The `-bl' option formats them like this:
  432.  
  433. .in +5
  434. .nf
  435. .na
  436.      if (x > 0)
  437.        {
  438.          x--;
  439.        }
  440.  
  441. .in -5
  442. .ad
  443. .fi
  444. If you use the `-bl' option, you may also want to specify the `-bli'
  445. option.  This option specifies the number of spaces by which braces are
  446. indented.  `-bli2', the default, gives the result shown above.  `-bli0'
  447. results in the following:
  448.  
  449. .in +5
  450. .nf
  451. .na
  452.      if (x > 0)
  453.      {
  454.        x--;
  455.      }
  456.  
  457. .in -5
  458. .ad
  459. .fi
  460. If you are using the `-br' option, you probably want to also use the
  461. `-ce' option.  This causes the `else' in an if-then-else construct to
  462. cuddle up to the immediately preceding `}'.  For example, with `-br
  463. -ce' you get the following:
  464.  
  465. .in +5
  466. .nf
  467. .na
  468.      if (x > 0) {
  469.        x--;
  470.      } else {
  471.        fprintf (stderr, "...something wrong?\n");
  472.      }
  473.  
  474. .in -5
  475. .ad
  476. .fi
  477. With `-br -nce' that code would appear as
  478.  
  479. .in +5
  480. .nf
  481. .na
  482.      if (x > 0) {
  483.        x--;
  484.      }
  485.      else {
  486.        fprintf (stderr, "...something wrong?\n");
  487.      }
  488.  
  489. .in -5
  490. .ad
  491. .fi
  492. The `-cli' option specifies the number of spaces that case labels
  493. should be indented to the right of the containing `switch' statement.
  494.  
  495. If a semicolon is on the same line as a `for' or `while' statement,
  496. the `-ss' option will cause a space to be placed before the semicolon. 
  497. This emphasizes the semicolon, making it clear that the body of the
  498. `for' or `while' statement is an empty statement. `-nss' disables this
  499. feature.
  500.  
  501. The `-pcs' option causes a space to be placed between the name of
  502. the procedure being called and the `(' (for example, `puts ("Hi");'. 
  503. The `-npcs' option would give `puts("Hi");').
  504.  
  505. If the `-cs' option is specified, `indent' puts a space after a cast
  506. operator.
  507.  
  508. The `-bs' option ensures that there is a space between the keyword
  509. `sizeof' and its argument.  In some versions, this is known as the
  510. `Bill_Shannon' option.
  511. .SH "DECLARATIONS"
  512. By default `indent' will line up identifiers, in the column
  513. specified by the `-di' option.  For example, `-di16' makes things look
  514. like:
  515.  
  516. .in +5
  517. .nf
  518. .na
  519.      int             foo;
  520.      char           *bar;
  521.  
  522. .in -5
  523. .ad
  524. .fi
  525. Using a small value (such as one or two) for the `-di' option can be
  526. used to cause the indentifiers to be placed in the first available
  527. position, for example
  528.  
  529. .in +5
  530. .nf
  531. .na
  532.      int foo;
  533.      char *bar;
  534.  
  535. .in -5
  536. .ad
  537. .fi
  538. The value given to the `-di' option will still affect variables
  539. which are put on separate lines from their types, for example `-di2'
  540. will lead to
  541.  
  542. .in +5
  543. .nf
  544. .na
  545.      int
  546.        foo;
  547.  
  548. .in -5
  549. .ad
  550. .fi
  551. If the `-bc' option is specified, a newline is forced after each
  552. comma in a declaration.  For example,
  553.  
  554. .in +5
  555. .nf
  556. .na
  557.      int a,
  558.        b,
  559.        c;
  560.  
  561. .in -5
  562. .ad
  563. .fi
  564. With the `-nbc' option this would look like
  565.  
  566. .in +5
  567. .nf
  568. .na
  569.      int a, b, c;
  570.  
  571. .in -5
  572. .ad
  573. .fi
  574. The `-psl' option causes the type of a procedure being defined to be
  575. placed on the line before the name of the procedure.  This style is
  576. required for the `etags' program to work correctly, as well as some of
  577. the `c-mode' functions of Emacs.
  578.  
  579. If you are not using the `-di1' option to place variables being
  580. declared immediately after their type, you need to use the `-T' option
  581. to tell `indent' the name of all the typenames in your program that are
  582. defined by `typedef'.  `-T' can be specified more than once, and all
  583. names specified are used.  For example, if your program contains
  584.  
  585. .in +5
  586. .nf
  587. .na
  588.      typedef unsigned long CODE_ADDR;
  589.      typedef enum {red, blue, green} COLOR;
  590.  
  591. .in -5
  592. .ad
  593. .fi
  594. you would use the options `-T CODE_ADDR -T COLOR'.
  595. .SH "INDENTATION"
  596. One issue in the formatting of code is how far each line should be
  597. indented from the left margin.  When the beginning of a statement such
  598. as `if' or `for' is encountered, the indentation level is increased by
  599. the value specified by the `-i' option.  For example, use `-i8' to
  600. specify an eight character indentation for each level. When a statement
  601. is continued from a previous line, it is indented by a number of
  602. additional spaces specified by the `-ci' option. `-ci' defaults to 0. 
  603. However, if the `-lp' option is specified, and a line has a left
  604. parenthesis which is not closed on that line, then continuation lines
  605. will be lined up to start at the character position just after the left
  606. parenthesis.  This processing also applies to `[' and applies to `{'
  607. when it occurs in initialization lists.  For example, a piece of
  608. continued code might look like this with `-nlp -ci3' in effect:
  609.  
  610. .in +5
  611. .nf
  612. .na
  613.        p1 = first_procedure (second_procedure (p2, p3),
  614.           third_procedure (p4, p5));
  615.  
  616. .in -5
  617. .ad
  618. .fi
  619. With `-lp' in effect the code looks somewhat clearer:
  620.  
  621. .in +5
  622. .nf
  623. .na
  624.        p1 = first_procedure (second_procedure (p2, p3),
  625.                              third_procedure (p4, p5));
  626.  
  627. .in -5
  628. .ad
  629. .fi
  630. `indent' assumes that tabs are placed at regular intervals of both
  631. input and output character streams.  These intervals are by default 8
  632. columns wide, but (as of version 1.2) may be changed by the `-ts'
  633. option.  Tabs are treated as the equivalent number of spaces.
  634.  
  635. The indentation of type declarations in old-style function
  636. definitions is controlled by the `-ip' parameter.  This is a numeric
  637. parameter specifying how many spaces to indent type declarations.  For
  638. example, the default `-ip5' makes definitions look like this:
  639.  
  640. .in +5
  641. .nf
  642. .na
  643.      char *
  644.      create_world (x, y, scale)
  645.           int x;
  646.           int y;
  647.           float scale;
  648.      {
  649.        . . .
  650.      }
  651.  
  652. .in -5
  653. .ad
  654. .fi
  655. For compatibility with other versions of indent, the option `-nip'
  656. is provided, which is equivalent to `-ip0'.
  657.  
  658. .SH "MISCELLANEOUS OPTIONS"
  659. To find out what version of `indent' you have, use the command
  660. `indent -version'.  This will report the version number of `indent',
  661. without doing any of the normal processing.
  662.  
  663. The `-v' option can be used to turn on verbose mode.  When in
  664. verbose mode, `indent' reports when it splits one line of input into
  665. two more more lines of output, and gives some size statistics at
  666. completion.
  667. .SH "COPYRIGHT"
  668. The following copyright notice applies to the `indent' program. The
  669. copyright and copying permissions for this manual appear near the
  670. beginning of this document.
  671. .nf
  672. .na
  673.      Copyright (c) 1989, 1992 Free Software Foundation
  674.      Copyright (c) 1985 Sun Microsystems, Inc.
  675.      Copyright (c) 1980 The Regents of the University of California.
  676.      Copyright (c) 1976 Board of Trustees of the University of Illinois.
  677.      All rights reserved.
  678.      
  679.      Redistribution and use in source and binary forms are permitted
  680.      provided that the above copyright notice and this paragraph are
  681.      duplicated in all such forms and that any documentation,
  682.      advertising materials, and other materials related to such
  683.      distribution and use acknowledge that the software was developed
  684.      by the University of California, Berkeley, the University of Illinois,
  685.      Urbana, and Sun Microsystems, Inc.  The name of either University
  686.      or Sun Microsystems may not be used to endorse or promote products
  687.      derived from this software without specific prior written permission.
  688.      THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  689.      IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  690.      WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
  691.      PURPOSE.
  692. .ad
  693. .fi
  694. .SH OPTIONS
  695. Here is a list of all the options for `indent', alphabetized by
  696. short option.  It is followed by a cross key alphabetized by long
  697. option.
  698.  
  699. .nf
  700. .na
  701. `-bad'
  702. `--blank-lines-after-declarations'
  703.      Force blank lines after the declarations.
  704.  
  705. `-bap'
  706. `--blank-lines-after-procedures'
  707.      Force blank lines after procedure bodies.
  708.  
  709. `-bbb'
  710. `--blank-lines-after-block-comments'
  711.      Force blank lines after block comments.
  712.  
  713. `-bc'
  714. `--blank-lines-after-commas'
  715.      Force newline after comma in declaration.
  716.  
  717. `-bl'
  718. `--braces-after-if-line'
  719.      Put braces on line after `if', etc.
  720.  
  721. `-bliN'
  722. `--brace-indentN'
  723.      Indent braces N spaces.
  724.  
  725. `-br'
  726. `--braces-on-if-line'
  727.      Put braces on line with `if', etc.
  728.  
  729. `-cN'
  730. `--comment-indentationN'
  731.      Put comments to the right of code in column N.
  732.  
  733. `-cdN'
  734. `--declaration-comment-columnN'
  735.      Put comments to the right of the declarations in column N.
  736.  
  737. `-cdb'
  738. `--comment-delimiters-on-blank-lines'
  739.      Put comment delimiters on blank lines.
  740.  
  741. `-ce'
  742. `--cuddle-else'
  743.      Cuddle else and preceeding `}'.
  744.  
  745. `-ciN'
  746. `--continuation-indentationN'
  747.      Continuation indent of N spaces.
  748.  
  749. `-cliN'
  750. `--case-indentationN'
  751.      Case label indent of N spaces.
  752.  
  753. `-cpN'
  754. `--else-endif-columnN'
  755.      Put comments to the right of `#else' and `#endif' statements in
  756.      column N.
  757.  
  758. `-cs'
  759. `--space-after-cast'
  760.      Put a space after a cast operator.
  761.  
  762. `-bs'
  763. `--blank-before-sizeof'
  764.      Put a space between `sizeof' and its argument.
  765.  
  766. `-dN'
  767. `--line-comments-indentationN'
  768.      Set indentation of comments not to the right of code to N spaces.
  769.  
  770. `-diN'
  771. `--declaration-indentationN'
  772.      Put variables in column N.
  773.  
  774. `-fc1'
  775. `--format-first-column-comments'
  776.      Format comments in the first column.
  777.  
  778. `-fca'
  779. `--format-all-comments'
  780.      Do not disable all formatting of comments.
  781.  
  782. `-gnu'
  783. `--gnu-style'
  784.      Use GNU coding style.  This is the default.
  785.  
  786. `-iN'
  787. `--indent-levelN'
  788.      Set indentation level to N spaces.
  789.  
  790. `-ipN'
  791. `--parameter-indentationN'
  792.      Indent parameter types in old-style function definitions by N
  793.      spaces.
  794.  
  795. `-kr'
  796. `--k-and-r-style'
  797.      Use Kernighan & Ritchie coding style.
  798.  
  799. `-lN'
  800. `--line-lengthN'
  801.      Set maximum line length to N.
  802.  
  803. `-lp'
  804. `--continue-at-parentheses'
  805.      Line up continued lines at parentheses.
  806.  
  807. `-nbad'
  808. `--no-blank-lines-after-declarations'
  809.      Do not force blank lines after declarations.
  810.  
  811. `-nbap'
  812. `--no-blank-lines-after-procedures'
  813.      Do not force blank lines after procedure bodies.
  814.  
  815. `-nbbb'
  816. `--no-blank-lines-after-block-comments'
  817.      Do not force blank-lines after block comments.
  818.  
  819. `-nbc'
  820. `--no-blank-lines-after-commas'
  821.      Do not force newlines after commas in declarations.
  822.  
  823. `-ncdb'
  824. `--no-comment-delimiters-on-blank-lines'
  825.      Do not put comment delimiters on blank lines.
  826.  
  827. `-nce'
  828. `--dont-cuddle-else'
  829.      Do not cuddle `}' and `else'.
  830.  
  831. `-ncs'
  832. `--no-space-after-casts'
  833.      Do not put a space after cast operators.
  834.  
  835. `-nfc1'
  836. `--dont-format-first-column-comments'
  837.      Do not format comments in the first column as normal.
  838.  
  839. `-nfca'
  840. `--dont-format-comments'
  841.      Do not format any comments.
  842.  
  843. `-nip'
  844. `--no-parameter-indentation'
  845.      Zero width indentation for parameters.
  846.  
  847. `-nlp'
  848. `--dont-line-up-parentheses'
  849.      Do not line up parentheses.
  850.  
  851. `-npcs'
  852. `--no-space-after-function-call-names'
  853.      Do not put space after the function in function calls.
  854.  
  855. `-npsl'
  856. `--dont-break-procedure-type'
  857.      Put the type of a procedure on the same line as its name.
  858.  
  859. `-nsc'
  860. `--dont-star-comments'
  861.      Do not put the `*' character at the left of comments.
  862.  
  863. `-nsob'
  864. `--leave-optional-blank-lines'
  865.      Do not swallow optional blank lines.
  866.  
  867. `-nss'
  868. `--dont-space-special-semicolon'
  869.      Do not force a space before the semicolon after certain statements.
  870.      Disables `-ss'.
  871.  
  872. `-nv'
  873. `--no-verbosity'
  874.  
  875. `-orig'
  876. `--original'
  877.      Use the original Berkeley coding style.
  878.  
  879. `-npro'
  880. `--ignore-profile'
  881.      Do not read `.indent.pro' files.
  882.  
  883. `-pcs'
  884. `--space-after-procedure-calls'
  885.      Insert a space between the name of the procedure being called and
  886.      the `('.
  887.  
  888. `-psl'
  889. `--procnames-start-lines'
  890.      Put the type of a procedure on the line before its name.
  891.  
  892. `-sc'
  893. `--start-left-side-of-comments'
  894.      Put the `*' character at the left of comments.
  895.  
  896. `-sob'
  897. `--swallow-optional-blank-lines'
  898.      Swallow optional blank lines.
  899.  
  900. `-ss'
  901. `--space-special-semicolon'
  902.      On one-line `for' and `while' statments, force a blank before the
  903.      semicolon.
  904.  
  905. `-st'
  906. `--standard-output'
  907.      Write to standard output.
  908.  
  909. `-T'
  910.      Tell `indent' the name of typenames.
  911.  
  912. `-tsN'
  913. `--tab-sizeN'
  914.      Set tab size to N spaces.
  915.  
  916. `-v'
  917. `--verbose'
  918.      Enable verbose mode.
  919.  
  920. `-version'
  921.      Output the version number of `indent'.
  922.  
  923. .ad
  924. .fi
  925. .SH "OPTIONS CROSS-REFERENCE"
  926. Here is a list of options alphabetized by long option, to help you
  927. find the corresponding short option.
  928.  
  929. .in +5
  930. .nf
  931. .na
  932.      --blank-lines-after-block-comments              -bbb
  933.      --blank-lines-after-commas                      -bc
  934.      --blank-lines-after-declarations                -bad
  935.      --blank-lines-after-procedures                  -bap
  936.      --braces-after-if-line                          -bl
  937.      --brace-indent                                  -bli
  938.      --braces-on-if-line                             -br
  939.      --case-indentation                              -cliN
  940.      --comment-delimiters-on-blank-lines             -cdb
  941.      --comment-indentation                           -cN
  942.      --continuation-indentation                      -ciN
  943.      --continue-at-parentheses                       -lp
  944.      --cuddle-else                                   -ce
  945.      --declaration-comment-column                    -cdN
  946.      --declaration-indentation                       -diN
  947.      --dont-break-procedure-type                     -npsl
  948.      --dont-cuddle-else                              -nce
  949.      --dont-format-comments                          -nfca
  950.      --dont-format-first-column-comments             -nfc1
  951.      --dont-line-up-parentheses                      -nlp
  952.      --dont-space-special-semicolon                  -nss
  953.      --dont-star-comments                            -nsc
  954.      --else-endif-column                             -cpN
  955.      --format-all-comments                           -fca
  956.      --format-first-column-comments                  -fc1
  957.      --gnu-style                                     -gnu
  958.      --ignore-profile                                -npro
  959.      --indent-level                                  -iN
  960.      --k-and-r-style                                 -kr
  961.      --leave-optional-blank-lines                    -nsob
  962.      --line-comments-indentation                     -dN
  963.      --line-length                                   -lN
  964.      --no-blank-lines-after-block-comments           -nbbb
  965.      --no-blank-lines-after-commas                   -nbc
  966.      --no-blank-lines-after-declarations             -nbad
  967.      --no-blank-lines-after-procedures               -nbap
  968.      --no-comment-delimiters-on-blank-lines          -ncdb
  969.      --no-space-after-casts                          -ncs
  970.      --no-parameter-indentation                      -nip
  971.      --no-space-after-function-call-names            -npcs
  972.      --no-verbosity                                  -nv
  973.      --original                                      -orig
  974.      --parameter-indentation                         -ipN
  975.      --procnames-start-lines                         -psl
  976.      --space-after-cast                              -cs
  977.      --space-after-procedure-calls                   -pcs
  978.      --space-special-semicolon                       -ss
  979.      --standard-output                               -st
  980.      --start-left-side-of-comments                   -sc
  981.      --swallow-optional-blank-lines                  -sob
  982.      --tab-size                                      -tsN
  983.      --verbose                                       -v
  984.  
  985. .in -5
  986. .ad
  987. .fi
  988. .SH "RETURN VALUE"
  989. Unknown
  990. .SH FILES
  991. .br
  992. .nf
  993. .\" set tabstop to longest possible filename, plus a wee bit
  994. .ta \w'/usr/lib/perl/getopts.pl   'u
  995. \fI$HOME/.indent.pro\fR    holds default options for indent.
  996. .SH AUTHOR
  997. The Free Software Foundation.
  998. .SH HISTORY
  999. Derived from the UCB program "indent".
  1000.